﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

public partial class Download : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string file = Request["name"];
        if (!string.IsNullOrEmpty(file) && File.Exists(file))
        {
            FileInfo fileInfo = new FileInfo(file);
            Response.AppendHeader("Content-Disposition", "attachment;filename=" + fileInfo.Name); 
            //Response.WriteFile(file,true);
            Response.TransmitFile(file);
        }
    }
}